<template>
  <a-form ref="formRef" :model="form" :rules="rules" layout="vertical">
    <a-row :gutter="20">
      <a-col :span="12">
        <a-form-item name="code">
          <template #label>
            <span>
              存货编码
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.code" allow-clear placeholder="请输入存货编码（对erp和tc的唯一编码）" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="specs">
          <template #label>
            <span>
              规格型号
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.specs" allow-clear placeholder="请输入规格型号" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="itemcode">
          <template #label>
            <span>
              件号
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.itemcode" allow-clear placeholder="请输入件号" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="itemname">
          <template #label>
            <span>
              件名
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.itemname" allow-clear placeholder="请输入件名" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="itemformat">
          <template #label>
            <span>
              产品规格
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.itemformat" allow-clear placeholder="请输入产品规格" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="model">
          <template #label>
            <span>
              型别（流卡）
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.model" allow-clear placeholder="请输入型别(流卡用)（型号）" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="design">
          <template #label>
            <span>
              设计图版式
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <a-input v-model:value="form.design" allow-clear placeholder="请输入设计图版式" />           
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="classcode">
          <template #label>
            <span>
              分类编码
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <dict-select v-model:value="form.classcode" valueType="dictCode" dictTypeId="1726404220507590658" placeholder="请选择" />            
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="keylevel">
          <template #label>
            <span>
              关、重标识
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <dict-select v-model:value="form.keylevel" valueType="dictCode" dictTypeId="1726408945474932737" placeholder="请选择" />            
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item name="unitgroupcode">
          <template #label>
            <span>
              计量单位
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <dict-select v-model:value="form.unitgroupcode" valueType="dictCode" dictTypeId="1726407642518589442" placeholder="请选择" />            
        </a-form-item>
      </a-col>
      <a-col :span="24">
        <a-form-item name="schedulingtype">
          <template #label>
            <span>
              排产类型
              <a-tooltip v-if="false">
                <template #title></template>
                <QuestionCircleOutlined />
              </a-tooltip>
              <span>：</span>
            </span>
          </template>
          <dict-select v-model:value="form.schedulingtype" valueType="dictCode" dictTypeId="1726385385662517249" placeholder="请选择" />            
        </a-form-item>
      </a-col>
    </a-row>


  </a-form>
</template>

<script setup name="ItemForm">
import { reactive, ref } from 'vue';
import DictSelect from '@/components/DictSelect/DictSelect.vue';


const props = defineProps({
  // 表单数据
  form: Object
});

// 验证规则
const rules = reactive({
  code: [{ required: true,  message: '请输入存货编码（对erp和tc的唯一编码）', type: 'string', trigger: 'blur' }],
  specs: [{ required: true,  message: '请输入规格型号', type: 'string', trigger: 'blur' }],
  itemcode: [{ required: true,  message: '请输入件号', type: 'string', trigger: 'blur' }],
  itemname: [{ required: true,  message: '请输入件名', type: 'string', trigger: 'blur' }],
});



defineExpose({
})
</script>

<style></style>
